require 'socket'

Socket.tcp('qq.com',80) do |conn|
  conn.write "GET / HTTP/1.1\r\n"
  conn.close
end

client = Socket.tcp('qq.com',80)